home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Day Cry
/
Day Cry CD.bin
/
oh_towns
/
ugoku
/
src.lzh
/
MOVREC
/
MRCXPAC.C
< prev
next >
Wrap
Text File
|
1994-09-09
|
38KB
|
1,423 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include <file_dlg.h>
#include <tifflib.h>
#include <egb.h>
#include <mos.h>
#include <snd.h>
#include "video.h"
#include "ugoku.h"
#include "old_mov.h"
#include "mrcdef.h"
extern int mouseSwCheck() ;
extern int errorCheck( int ) ;
extern char *guiEgbPtr ; /* EGB é╠âÅü[âNâAâhâîâX */
extern char *rbuf ; /* Ä⌐ë╞É╗é╠âÅü[âNâAâhâîâX */
extern char *bbuf ; /* Ä⌐ë╞É╗é╠âÅü[âNâAâhâîâX */
extern int xtif, ytif ; /* tiffdataé╠Åcëíò¥ */
//extern char tifName[][16] ;
//extern int tifTotal ;
extern int baseDialogId ;
int pacDialogId = -1 ;
int pacSubDialogId = -1 ;
int pacRoughBar = -1 ;
int pacRoughNumId = -1 ;
int pacMesId[8] = -1 ;
int pacTIconId[2] = -1 ;
int pacFilterBar = -1 ;
int pacFilterNumId = -1 ;
int pacOKBtnId = -1 ;
int pacCanBtnId = -1 ;
int pacWaitDialogId = -1 ;
int pacWaitMesId[2] = -1 ;
int pacWaitNumId[2] = -1 ;
static int svar[] = { 0,0,0,0,0,0,319,239,0,0,0, 0,0,0 };
/*
svar[] = { frame, total_byte, rough, premove, x0,y0,x1,y1, b,r,g,
soft, color_rate, mode }
ü¬ ü¬é▒é╠2é┬é═èOòöé⌐éτéóé╢é┴é─é═é╛é▀
*/
static int pacRough = 0 ;
static int idouMode = 1 ;
static int pacFilter = 0 ;
static int pacOkFlg ;
/* ô«ëµì∞ɼ(ÉVïK) */
tifToMov( namemov, path, total, nbuffer )
char *namemov, path[], nbuffer[][16] ;
int total ;
{
int error ;
MMI_SendMessage( pacDialogId, MM_ATTACH, 1, baseDialogId ) ;
MTL_setFlagObj( pacTIconId[idouMode+0], (MS_UNSELECT | MS_TOGGLE) ) ;
MMI_SendMessage( pacDialogId, MM_SHOW, 0 ) ; /* î⌐é╣éΘ */
MMI_ExecSystem() ; /* Dialogò\Īé╓ÑÑÑâCâxâôâgâïü[âv */
svar[0] = 0 ;
svar[1] = 0 ;
svar[2] = pacRough ;
svar[3] = idouMode * 8 ;
svar[11] = pacFilter ;
MMI_SendMessage( pacDialogId, MM_ERASE, 0 ) ;
MMI_SendMessage( pacDialogId, MM_DETACH, 0 ) ;
error = 0 ;
if( pacOkFlg == TRUE )
{
EGB_writePage(guiEgbPtr,0);
EGB_color( guiEgbPtr, 1, 0 ) ;
EGB_clearScreen(guiEgbPtr); /* clear */
EGB_displayStart(guiEgbPtr,3,0,0);
EGB_displayStart(guiEgbPtr,2,1,1);
EGB_displayStart(guiEgbPtr,2,2,2);
EGB_displayStart(guiEgbPtr,0,0,0);
EGB_displayStart(guiEgbPtr,1,0,0);
EGB_displayStart(guiEgbPtr,3,320,240);
EGB_displayPage(guiEgbPtr,1,3);
EGB_writePage(guiEgbPtr,1); /* pageé≡î│é╔û▀é│é╚éóé╞û\æû */
tifToMovSet( total ) ;
SetMouse16( 81, 0xf, 0x8 ) ; /* â}âEâXâJü[â\âïé≡âEâGâCâgò\Ī */
error = mov_save( namemov, path, total, nbuffer ) ;
SetMouse16( 80, 0xf, 0x8 ) ; /* â}âEâXâJü[â\âïé≡î│é╔ */
tifToMovReset() ;
EGB_displayPage(guiEgbPtr,1,2);
}
MMI_FlushEvnt() ; /* âCâxâôâgé≡âtâëâbâVâà */
/* â}âEâXé¬ëƒé│éΩé─éóéΩé╬ăé╠âCâxâôâgé≡û│Äï */
if( mouseSwCheck() )TL_setInvalidMosFlag() ;
if( error )
{
errorCheck( error ) ;
}
return NOERR ;
}
/* ô«ëµì∞ɼ(Æ╟ë┴) */
tifToMovAdd( namemov, path, total, nbuffer )
char *namemov, path[], nbuffer[][16] ;
int total ;
{
int error ;
MMI_SendMessage( pacDialogId, MM_ATTACH, 1, baseDialogId ) ;
MTL_setFlagObj( pacTIconId[idouMode+0], (MS_UNSELECT | MS_TOGGLE) ) ;
MMI_SendMessage( pacDialogId, MM_SHOW, 0 ) ; /* î⌐é╣éΘ */
MMI_ExecSystem() ; /* Dialogò\Īé╓ÑÑÑâCâxâôâgâïü[âv */
svar[2] = pacRough ;
svar[3] = idouMode * 8 ;
svar[11] = pacFilter ;
MMI_SendMessage( pacDialogId, MM_ERASE, 0 ) ;
MMI_SendMessage( pacDialogId, MM_DETACH, 0 ) ;
error = 0 ;
if( pacOkFlg == TRUE )
{
EGB_writePage(guiEgbPtr,0);
EGB_color( guiEgbPtr, 1, 0 ) ;
EGB_clearScreen(guiEgbPtr); /* clear */
EGB_displayStart(guiEgbPtr,3,0,0);
EGB_displayStart(guiEgbPtr,2,1,1);
EGB_displayStart(guiEgbPtr,2,2,2);
EGB_displayStart(guiEgbPtr,0,0,0);
EGB_displayStart(guiEgbPtr,1,0,0);
EGB_displayStart(guiEgbPtr,3,320,240);
EGB_displayPage(guiEgbPtr,1,1);
EGB_writePage(guiEgbPtr,1); /* pageé≡î│é╔û▀é│é╚éóé╞û\æû */
error = mov_head_read(namemov, svar) ; /* headô╟é±é┼frameé≡æùéΘ */
if( error == NOERR )
{
tifToMovSet( total ) ;
EGB_displayPage(guiEgbPtr,1,3);
SetMouse16( 81, 0xf, 0x8 ) ; /* â}âEâXâJü[â\âïé≡âEâGâCâgò\Ī */
error = mov_save( namemov, path, total, nbuffer ) ;
SetMouse16( 80, 0xf, 0x8 ) ; /* â}âEâXâJü[â\âïé≡î│é╔ */
tifToMovReset() ;
}
EGB_displayPage(guiEgbPtr,1,2);
}
MMI_FlushEvnt() ; /* âCâxâôâgé≡âtâëâbâVâà */
/* â}âEâXé¬ëƒé│éΩé─éóéΩé╬ăé╠âCâxâôâgé≡û│Äï */
if( mouseSwCheck() )TL_setInvalidMosFlag() ;
if( error )
{
errorCheck( error ) ;
}
return NOERR ;
}
tifToMovSet( total )
int total ;
{
extern int r_waku_clear1( int, int, int ) ;
EGB_writePage(guiEgbPtr,1);
r_waku_clear1( 320, 240, 2 ) ;
MMI_SendMessage( pacWaitDialogId, MM_ATTACH, 1, baseDialogId ) ;
MMI_SendMessage( pacWaitNumId[0], MM_SETNUMBOX, 5,
total+svar[0], 0, total+svar[0], 1, 0 ) ; /* î┤ëµâtâîü[âÇÉöÉ▌ÆΦ */
/* var, min, max, delta, ptColumn */
MMI_SendMessage( pacWaitNumId[1], MM_SETNUMBOX, 5,
0, 0, total+svar[0], 1, 0 ) ; /* ê│Åkâtâîü[âÇÉöÉ▌ÆΦ */
/* var, min, max, delta, ptColumn */
MMI_SendMessage( pacWaitDialogId, MM_SHOW, 0 ) ;
return NOERR ;
}
tifToMovReset()
{
extern int r_waku_del() ;
EGB_writePage(guiEgbPtr,1);
MMI_SendMessage( pacWaitDialogId, MM_ERASE, 0 ) ;
MMI_SendMessage( pacWaitDialogId, MM_DETACH, 0 ) ;
r_waku_del() ;
return NOERR ;
}
/* initDataIRCPAC:pacRoughBar:MJ_SCRLL40é╠î─é╤Åoé╡è╓Éö */
int pacRoughSet(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
int var, min, max, len, page ;
MMI_SendMessage( kobj, MM_GETSCROLL, 5,
&var, &min, &max, &len, &page ) ;
pacRough = var*8 / 16 ; /* var * Ælé╠ÆåÉSÆl / âoü[é╠ÆåÉSé╠Æl */
MMI_SendMessage( pacRoughNumId, MM_SETNUMBOX, 5,
pacRough, 0, pacRough, 1, 0 ) ;
/* var, min, max, delta, ptColumn */
MMI_SendMessage( pacRoughNumId, MM_SHOW, 0 ) ;
return NOERR ;
}
/* initDataIRCPAC:pacFilterBar:MJ_SCRLL40é╠î─é╤Åoé╡è╓Éö */
int pacFilterSet(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
int var, min, max, len, page ;
MMI_SendMessage( kobj, MM_GETSCROLL, 5,
&var, &min, &max, &len, &page ) ;
pacFilter = var*8 / 16 ; /* var * Ælé╠ÆåÉSÆl / âoü[é╠ÆåÉSé╠Æl */
MMI_SendMessage( pacFilterNumId, MM_SETNUMBOX, 5,
pacFilter, 0, pacFilter, 1, 0 ) ;
/* var, min, max, delta, ptColumn */
MMI_SendMessage( pacFilterNumId, MM_SHOW, 0 ) ;
return NOERR ;
}
/* initDataIRCPAC:pacTIconId[0]:MJ_TICONL40é╠î─é╤Åoé╡è╓Éö */
/* initDataIRCPAC:pacTIconId[1]:MJ_TICONL40é╠î─é╤Åoé╡è╓Éö */
int pacIdouFunc(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
if( kobj == pacTIconId[0] )
{
MTL_setFlagObj( pacTIconId[0], MS_UNSELECT ) ;
MTL_resetFlagObj( pacTIconId[idouMode+0],
(~(MS_UNSELECT | MS_TOGGLE)) ) ;
MMI_SendMessage( pacTIconId[idouMode+0], MM_SHOW, 0 ) ;
idouMode = 0 ;
}
else
if( kobj == pacTIconId[1] )
{
MTL_setFlagObj( pacTIconId[1], MS_UNSELECT ) ;
MTL_resetFlagObj( pacTIconId[idouMode+0],
(~(MS_UNSELECT | MS_TOGGLE)) ) ;
MMI_SendMessage( pacTIconId[idouMode+0], MM_SHOW, 0 ) ;
idouMode = 1 ;
}
return NOERR ;
}
/* initDataIRCPAC:pacOKBtnId:MJ_DBUTTONL40é╠î─é╤Åoé╡è╓Éö */
/* initDataIRCPAC:pacCanBtnId:MJ_DBUTTONL40é╠î─é╤Åoé╡è╓Éö */
int pacOKchk(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
pacOkFlg = 0 ;
if( kobj == pacOKBtnId )pacOkFlg = TRUE ;
MMI_SetHaltFlag( TRUE ) ;
return NOERR ;
}
/* mov2 head read */
mov_head_read(namemov, svar)
char *namemov;
int svar[];
{
FILE *fp;
int n, temp, page, size;
char head[256], para[80];
if( ( fp = fopen( namemov, "rb" ) ) == NULL )return 1;
temp = fread( head, 256, 1, fp );
if( temp < 1 )goto movh10;
if( DWORD( head+0 ) != 0x32564f4d )goto movh10;
if( DWORD( head+4 ) != 16 )goto movh10;
if( DWORD( head+16) != 320 )goto movh10;
if( DWORD( h